One popular protocol for wireless connectivity is Bluetooth. A recent version of this is the Bluetooth Low Energy (BLE) standard, also referred to as Bluetooth Smart.
Every Bluetooth device has an internal clock comprising a crystal oscillator which oscillates with a range of frequencies, typically 2 MHz, 1 MHz and 32 KHz. Many Low Power Bluetooth components depend on this clock, such as for the radio frequency “hops” that can happen with the lowest time as 200 μs. In a network of Bluetooth devices (termed a piconet), all devices must hop channels in the same manner to be able to communicate, and so all the devices' clocks must be synchronized.
However, Bluetooth does not provide time synchronisation as a service to applications. There is limited access to the internal Bluetooth clock and this access is via a slow serial connection between the main processor and the Host Controller Interface (HCl). Therefore, other methods of synchronisation must be used.
The BLE specification defines a connection model with a minimum connection interval of 7.5 ms. Rather than being continuously connected, the devices only temporarily connect (termed a connection event) once during each connection interval. The purpose of this is to save power, which is a key objective of the BLE standard. The advantage of having a relatively long connection interval is that significant power is saved, since a device can sleep most of the time between connection events.
However, one disadvantage of the long connection interval is that, if one device has data that it needs to send to another device, it must wait until the next connection event. This introduces an element of randomness to the timing of data exchange. The data that is to be sent may have been generated at any time between the previous and the next connection event. Under the BLE standard, and using the minimum connection interval, two devices cannot connect and exchange data more frequently than every 7.5 ms. Therefore, there will be a delay of between zero and 7.5 ms between the generation of the data and its transmission and receipt by the other device. The actual value of this delay is random and non-deterministic.
On a wired network or even a wireless network of permanently connected devices, the clock synchronisation of connected devices is typically straightforward using a common clock or by exchanging time stamps. However, the distributed nodes on a BLE wireless network have no common clock and so the local time of each node can drift. Exchanging time stamps while connected is of limited accuracy due to the delay of up to 7.5 ms for data exchange.
Various synchronisation methods for wireless networks are known but all rely on deterministic times for exchanging data. Also, many of these methods have limited accuracy. In certain practical applications, having an accuracy below 1 ms is necessary. Just one example of this is a network of sensors measuring brain activity using EEG.
A BLE device may operate in one of four different modes. The main modes of operation are called the broadcasting mode, scanning mode, initiator mode, master device mode, and slave device mode. Prior to connecting, a BLE device can be in broadcasting mode or scanning mode. In broadcasting mode, the BLE device periodically broadcasts advertising information and may respond with more information upon request from other devices. A device in scanning mode ‘listens’ to advertising information and may request additional information if active scanning is enabled. To establish a connection between two devices, one device has to be in broadcasting mode and the other device in initiator mode. The initiator scans for a desirable advertising packet and consequently sends a connection request. Once a connection is established, the initiator assumes the role of master device and the advertiser becomes a slave device.